package com.isunland.managesystem.ui;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BasePagerActivity;
import com.isunland.managesystem.entity.CustomerDialog;
import com.isunland.managesystem.entity.ProjectProgressOriginal.ProjectProgressSuper;

public class DetailProjectProgressActivity extends BasePagerActivity {
  private ProjectProgressSuper superContent;
  private String pmId = "";
  private String projectId = "";
  private String projectName = "";
  private String stageId = "";//阶段id
  private String stageName = "";//阶段名
  private CustomerDialog content;
  private int[] titles =
      { R.string.progressRegist, R.string.definedProperty, R.string.projecProgressDetail };

  @Override protected void onCreate(Bundle arg0) {
    superContent = (ProjectProgressSuper) getIntent().getSerializableExtra(
        DetailProjectProgressFragment.EXTRA_CONTENT);
    pmId = getIntent().getStringExtra(DetailProjectProgressFragment.EXTRA_PM_ID);
    projectId = getIntent().getStringExtra(DetailProjectProgressFragment.EXTRA_PROJECT_ID);
    projectName = getIntent().getStringExtra(DetailProjectProgressFragment.EXTRA_PROJECT_NAME);
    stageId = superContent.getId();
    stageName = superContent.getStageName();
    // 项目经理ID，阶段负责人ID，数据状态 realDataStatus，阶段ID，阶段名name
    content =
        new CustomerDialog(pmId, superContent.getChargeManId(), superContent.getRealDataStatus(),
            stageId, stageName);
    super.onCreate(arg0);
  }

  @Override protected Fragment createFragmentOne() {
    return StageRegistListFragment.newInstence(content);//阶段进度登记列表
  }

  @Override protected Fragment createFragmentTwo() {
    return StageDefinePropertyListFragment.newInstence(content);//阶段自定义属性列表
  }

  @Override public Fragment createFragmentThree() {

    return DetailProjectProgressFragment.newInstance(superContent, pmId, projectId, projectName);
  }

  @Override protected int[] createTitle() {
    return titles;
  }
}
